package com.foreveross.vo;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Transient;

import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;
import org.springframework.format.annotation.DateTimeFormat;


/**
 * HouseUser entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "house_user", catalog = "hrtenement")
public class HouseUser implements java.io.Serializable {

	// Fields  

	private String id;
	private HrHouses hrHouses;
	private String houseId;
	private String name;
	private String sex;
	private String cusId;
	private String resId;
	private String cttId;
	private String IDCardName;
	private String IDCardNo;
	private String wechatId;
	private String telephone;
	private String type;
	private String address;
	private String home;
	private String resCode;
	private String buildingCode;
	private String buildingName;

	private String houseUnit;
	private Integer authenticationStatus;
	private String authenticationSysUserId;
	@DateTimeFormat(pattern="yyyy-MM-dd")
	private Date authenticationTime;
	private String housesName;
	private String codeDesc;
	private Integer isDomicile;
	
	private String expressAgreement;

	// Constructors

	/** default constructor */
	public HouseUser() {
	}

	/** minimal constructor */
	public HouseUser(String id) {
		this.id = id;
	}

	// Property accessors
	@Id
	@GenericGenerator(name = "idGenerator", strategy = "uuid")
	@GeneratedValue(generator = "idGenerator")
	@Column(name = "id", unique = true, nullable = false, length = 32)
	public String getId() {
		return this.id;
	}

	/** full constructor */
	public HouseUser(String id, HrHouses hrHouses, String houseId, String name, String sex, String cusId, String resId,
			String cttId, String iDCardName, String iDCardNo, String wechatId, String telephone, String type,
			String address, String home, String resCode, String buildingCode, String buildingName, String houseUnit,
			Integer authenticationStatus, String authenticationSysUserId, Date authenticationTime, String housesName,
			String codeDesc, Integer isDomicile, String expressAgreement) {
		super();
		this.id = id;
		this.hrHouses = hrHouses;
		this.houseId = houseId;
		this.name = name;
		this.sex = sex;
		this.cusId = cusId;
		this.resId = resId;
		this.cttId = cttId;
		IDCardName = iDCardName;
		IDCardNo = iDCardNo;
		this.wechatId = wechatId;
		this.telephone = telephone;
		this.type = type;
		this.address = address;
		this.home = home;
		this.resCode = resCode;
		this.buildingCode = buildingCode;
		this.buildingName = buildingName;
		this.houseUnit = houseUnit;
		this.authenticationStatus = authenticationStatus;
		this.authenticationSysUserId = authenticationSysUserId;
		this.authenticationTime = authenticationTime;
		this.housesName = housesName;
		this.codeDesc = codeDesc;
		this.isDomicile = isDomicile;
		this.expressAgreement = expressAgreement;
	}

	public void setId(String id) {
		this.id = id;
	}

	
	public String getBuildingCode() {
		return buildingCode;
	}

	public void setBuildingCode(String buildingCode) {
		this.buildingCode = buildingCode;
	}

	public String getBuildingName() {
		return buildingName;
	}

	public void setBuildingName(String buildingName) {
		this.buildingName = buildingName;
	}

	@JoinColumn(name = "house_id")
	@ManyToOne(fetch=FetchType.LAZY)
	@NotFound(action = NotFoundAction.IGNORE)
	public HrHouses getHrHouses() {
		return this.hrHouses;
	}

	public void setHrHouses(HrHouses hrHouses) {
		this.hrHouses = hrHouses;
	}

	@Column(name = "name")
	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Column(name = "sex")
	public String getSex() {
		return this.sex;
	}

	public void setSex(String sex) {
		this.sex = sex;
	}

	@Column(name = "CusID")
	public String getCusId() {
		return this.cusId;
	}

	public void setCusId(String cusId) {
		this.cusId = cusId;
	}

	@Column(name = "ResID")
	public String getResId() {
		return this.resId;
	}

	public void setResId(String resId) {
		this.resId = resId;
	}

	@Column(name = "CttID")
	public String getCttId() {
		return this.cttId;
	}

	public void setCttId(String cttId) {
		this.cttId = cttId;
	}

	@Column(name = "IDCardName")
	public String getIDCardName() {
		return IDCardName;
	}

	public void setIDCardName(String IDCardName) {
		this.IDCardName = IDCardName;
	}

	@Column(name = "IDCardNo")
	public String getIDCardNo() {
		return IDCardNo;
	}

	public void setIDCardNo(String IDCardNo) {
		this.IDCardNo = IDCardNo;
	}

	@Column(name = "wechat_id")
	public String getWechatId() {
		return this.wechatId;
	}

	public void setWechatId(String wechatId) {
		this.wechatId = wechatId;
	}

	@Column(name = "telepnoe")
	public String getTelephone() {
		return this.telephone;
	}

	public void setTelephone(String telephone) {
		this.telephone = telephone;
	}

	@Column(name = "type")
	public String getType() {
		return this.type;
	}

	public void setType(String type) {
		this.type = type;
	}

	@Column(name = "address")
	public String getAddress() {
		return this.address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	@Column(name = "home")
	public String getHome() {
		return this.home;
	}

	public void setHome(String home) {
		this.home = home;
	}

	@Column(name = "house_unit")
	public String getHouseUnit() {
		return this.houseUnit;
	}

	public void setHouseUnit(String houseUnit) {
		this.houseUnit = houseUnit;
	}

	@Column(name = "authentication_status")
	public Integer getAuthenticationStatus() {
		return this.authenticationStatus;
	}

	public void setAuthenticationStatus(Integer authenticationStatus) {
		this.authenticationStatus = authenticationStatus;
	}

	@Transient
	public String getAuthenticationSysUserId() {
		return authenticationSysUserId;
	}

	@Transient
	public Date getAuthenticationTime() {
		return authenticationTime;
	}

	public void setAuthenticationSysUserId(String authenticationSysUserId) {
		this.authenticationSysUserId = authenticationSysUserId;
	}

	public void setAuthenticationTime(Date authenticationTime) {
		this.authenticationTime = authenticationTime;
	}

	@Transient
	public String getHouseId() {
		if (this.hrHouses != null)
			return this.hrHouses.getId();
		return houseId;
	}

	public void setHouseId(String houseId) {
		this.houseId = houseId;
	}

	@Transient
	public String getHousesName() {
		if (this.hrHouses != null)
			return this.hrHouses.getName();
		return housesName;
	}

	public void setHousesName(String housesName) {
		this.housesName = housesName;
	}

	@Transient
	public String getCodeDesc() {
		return codeDesc;
	}

	public void setCodeDesc(String codeDesc) {
		this.codeDesc = codeDesc;
	}

	public Integer getIsDomicile() {
		return isDomicile;
	}

	public void setIsDomicile(Integer isDomicile) {
		this.isDomicile = isDomicile;
	}

	public String getResCode() {
		return resCode;
	}

	public void setResCode(String resCode) {
		this.resCode = resCode;
	}
	
	@Column(name = "express_agreement")
	public String getExpressAgreement() {
		return expressAgreement;
	}

	public void setExpressAgreement(String expressAgreement) {
		this.expressAgreement = expressAgreement;
	}

}